package com.itheima.utils;

/**
 * @author hebing
 * @version 1.0
 */
//线程用来存取值的工具类
public class BaseContext {

    private static final ThreadLocal<Long> THREAD_LOCAL_USERID=new ThreadLocal<>();

    /**
     * 获取值
     * @return
     */
    public static Long getCurrentId(){
        return THREAD_LOCAL_USERID.get();
    }

    /**
     * 设定值
     * @param currentId
     * @return
     */
    public static void setCurrentId(Long currentId){
        THREAD_LOCAL_USERID.set(currentId);
    }
}
